﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using SureKAM.BackUp.Notify.DataAccess;
using SureKAM.BackUp.Notify.DataAccess.implement;
using SureKAM.BackUp.Notify.Domain;

namespace SureKAM.BackUp.Noitfy.DataAccess.Test
{
    public class DNMappingTestFixture
    {
        private IDNMapping DnMapping;

        [TestFixtureSetUp]
        public  void  TestFixtureSetUp()
        {
            this.DnMapping = new DNMappingRes();
        }

        [Test]
        public void InsertDNTest()
        {
            DirectoryNotifyMapping directoryNotifyMapping=new DirectoryNotifyMapping();
            directoryNotifyMapping.Id = Guid.NewGuid().ToString();
            directoryNotifyMapping.DirectoryId = Guid.NewGuid().ToString();
            directoryNotifyMapping.NotifyId = Guid.NewGuid().ToString();
            this.DnMapping.InsertDN(directoryNotifyMapping);
            bool isTure = this.DnMapping.SaveToFile();
            Assert.IsTrue(isTure);
        }

        [Test]
        public void GetDNsTest()
        {
            List<Notify.Domain.DirectoryNotifyMapping> directoryNotifyMappings = this.DnMapping.GetDNs();
            Assert.IsNotNull(directoryNotifyMappings);
        }
    }
}
